import Vue from 'vue'
import VueRouter from 'vue-router'

// 页面导入
import login from '../views/login.vue'
import register from '../views/register.vue'
import index from '../views/index.vue'

import blog_announcement from '../views/blog-announcement.vue'
import blog_article from '../views/blog-article.vue'
import blog_bbs from '../views/blog-bbs.vue'
import blog_headline from '../views/blog-headline.vue'
import blog_niikappu from '../views/blog-niikappu.vue'
import blog_questions from '../views/blog-questions.vue'
import blog_keepHealth from '../views/blog-keepHealth.vue'
import portfolio_avoid from '../views/portfolio-avoid.vue'
import portfolio_identification from '../views/portfolio-identification.vue'
import space from '../views/space.vue'

// 分页导入
import blog_keepHealth_book from './keepHealth/keepHealth-book.vue'
import blog_keepHealth_season from './keepHealth/keepHealth-season.vue'
import blog_keepHealth_hour from './keepHealth/keepHealth-hour.vue'

import blog_bbs_index from './blogBBS/blogBBS-index.vue'
import blog_bbs_search from './blogBBS/blogBBS-search.vue'
import blog_bbs_detail from './blogBBS/blogBBS-detail.vue'
import blog_bbs_list from './blogBBS/blogBBS-list.vue'

Vue.use(VueRouter)

export default new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/blog-announcement',
            component: blog_announcement
        },
        {
            path: '/blog-article',
            component: blog_article
        },
        {
            path: '/blog-keepHealth',
            component: blog_keepHealth,
            children: [
                {
                    path: '/',
                    redirect: '/keepHealth-book'
                },
                {
                    // 当 /user/:id/profile 匹配成功，
                    // UserProfile 会被渲染在 User 的 <router-view> 中
                    path: '/keepHealth-book',
                    component: blog_keepHealth_book
                },
                {
                    path: '/keepHealth-season',
                    component: blog_keepHealth_season
                },
                {
                    path: '/keepHealth-hour',
                    component: blog_keepHealth_hour
                },
            ]
        },
        {
            path: '/blog-bbs',
            component: blog_bbs,
            children: [
                {
                    path: '/',
                    redirect: 'blog-bbs-index'
                },{
                    path: 'blog-bbs-index',
                    component: blog_bbs_index
                }, {
                    path: 'blog-bbs-search',
                    component: blog_bbs_search
                }, {
                    path: 'blog-bbs-detail',
                    component: blog_bbs_detail
                }, {
                    path: 'blog-bbs-list',
                    component: blog_bbs_list
                }
            ]
        },
        {
            path: '/blog-headline',
            component: blog_headline
        },
        {
            path: '/blog-niikappu',
            component: blog_niikappu
        },
        {
            path: '/blog-questions',
            component: blog_questions
        },
        {
            path: '/portfolio-avoid',
            component: portfolio_avoid,
        },
        {
            path: '/portfolio-identification',
            component: portfolio_identification
        },
        {
            path: '/space',
            component: space
        },
        {
            path: '/login',
            component: login
        },
        {
            path: '/register',
            component: register
        },
        {
            path: '/index',
            component: index
        },
        {
            path: '/',
            redirect: '/index'
        },
    ]
})